<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>table</title>
<link rel="stylesheet" href="layui/css/layui.css" media="all">
</head>
<body>
	<table id="demo" lay-filter="test"></table>

	<script src="layui/layui.js"></script>
	<script>
		layui.use('table', function() {
			var table = layui.table;

			//第一个实例
			table.render({
				elem : '#demo',
				height : 500,
				width :600,
				url : 'StudentServlet' //数据接口
				,
				page : true //开启分页
				,
				cols : [ [ //表头
				{
					field : 'stuid',
					title : '学生编号',
					width : 200,
					sort : true,
					fixed : 'left'
				}, {
					field : 'stuname',
					title : '学生姓名',
					width : 200
				}, {
					field : 'stuage',
					title : '年龄',
					width : 200,
					sort : true
				} ] ]
			});

		});
	</script>
</body>
</html>